<?php
	class Login_model extends CI_Model{
		
		function __construct(){
			parent::__construct();
			
		}
		
		function user_login($data){
			$query = $this->db->get_where('users', $data);
			if ($query->num_rows() > 0) {
			$value = $query->row();
			if($value->conform == 1){
			return $value;
			}else{
				return 0;
			}
		}
		}	
		function verify(){
			$first_name = $this->uri->segment(3);
			$code = $this->uri->segment(4);
			
			$conform = 1;
		$query = $this->db->where('first_name', $first_name);
		$query = $this->db->where('conformcode', $code);
		$query = $this->db->where('conform', 0);
		$query = $this->db->update('users', array('conform'=>$conform));
			return true;
		
		}
	}
?>

